home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / etc / init.d / memlockd < prev    next >
Encoding:
Text File  |  2013-01-10  |  2.1 KB  |  86 lines

  1. #! /bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides:          memlockd
  4. # Required-Start:    $remote_fs $syslog
  5. # Required-Stop:
  6. # Default-Start:     2 3 4 5
  7. # Default-Stop:
  8. ### END INIT INFO
  9. #
  10. # skeleton    example file to build /etc/init.d/ scripts.
  11. #        This file should be used to construct scripts for /etc/init.d.
  12. #
  13. #        Written by Miquel van Smoorenburg <miquels@cistron.nl>.
  14. #        Modified for Debian 
  15. #        by Ian Murdock <imurdock@gnu.ai.mit.edu>.
  16. #
  17. # Version:    @(#)skeleton  1.9  26-Feb-2001  miquels@cistron.nl
  18. #
  19.  
  20. PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
  21. DAEMON=/usr/sbin/memlockd
  22. NAME=memlockd
  23. DESC=memlockd
  24.  
  25. test -x $DAEMON || exit 0
  26.  
  27. # Include memlockd defaults if available
  28. if [ -f /etc/default/memlockd ] ; then
  29.     . /etc/default/memlockd
  30. fi
  31.  
  32. set -e
  33.  
  34. case "$1" in
  35.   start)
  36.     echo -n "Starting $DESC: "
  37.     start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
  38.         --exec $DAEMON -- $DAEMON_OPTS
  39.     echo "$NAME."
  40.     ;;
  41.   stop)
  42.     echo -n "Stopping $DESC: "
  43.     start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
  44.         --exec $DAEMON
  45.     echo "$NAME."
  46.     ;;
  47.   reload)
  48.     #
  49.     #    If the daemon can reload its config files on the fly
  50.     #    for example by sending it SIGHUP, do it here.
  51.     #
  52.     #    If the daemon responds to changes in its config file
  53.     #    directly anyway, make this a do-nothing entry.
  54.     #
  55.     echo "Reloading $DESC configuration files."
  56.     start-stop-daemon --stop --signal 1 --quiet --pidfile \
  57.         /var/run/$NAME.pid --exec $DAEMON
  58.   ;;
  59.   force-reload)
  60.     #
  61.     #    If the "reload" option is implemented, move the "force-reload"
  62.     #    option to the "reload" entry above. If not, "force-reload" is
  63.     #    just the same as "restart" except that it does nothing if the
  64.     #   daemon isn't already running.
  65.     # check wether $DAEMON is running. If so, restart
  66.     start-stop-daemon --stop --test --quiet --pidfile \
  67.         /var/run/$NAME.pid --exec $DAEMON \
  68.     && $0 restart \
  69.     || exit 0
  70.     ;;
  71.   restart)
  72.     $0 start && exit 0
  73.     echo -n "Restarting $DESC: "
  74.     $DAEMON $DAEMON_OPTS
  75.     echo "$NAME."
  76.     ;;
  77.   *)
  78.     N=/etc/init.d/$NAME
  79.     # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
  80.     echo "Usage: $N {start|stop|restart|force-reload}" >&2
  81.     exit 1
  82.     ;;
  83. esac
  84.  
  85. exit 0
  86.